package com.chenshu.springboot_demo.logging;

import com.chenshu.springboot_demo.config.controller.TestController;


import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-07
 * Time：21:01
 */
@RestController
@Slf4j
public class LoggingController {
    //private static Logger log = LoggerFactory.getLogger(LoggingController.class);

    @RequestMapping("loggingtest1")
    public void loggingTest1() {
        log.info("This is my first Spring Boot Log.");
    }

    @RequestMapping("loggingtest2")
    public void loggingTest2() {
        //追溯
        log.trace("log level: trace");
        //调试
        log.debug("log level: debug");
        //信息
        log.info("log level: info");
        //警告
        log.warn("log level: warn");
        //错误
        log.error("log level: error");
    }
}
